var lk = {
    callback: function (resposer, callback) {
        if (!resposer.status) {
            $.error.call(this, resposer.msg);
        } else if (callback && typeof callback) {
            callback.call(this, resposer);
        }
    },
    error: function (error) {
        layer.alert(error, {
            icon: 2,
            skin: 'layer-ext-moon'
        });
    },
    ajax1: function (that, url, type, params, callback) {
        $.ajax({
            url: url,
            type: type,
            data: params,
            success: function (result, status, xhr) {
                $.callback.call(that, result, callback);
            },
            error: function (xhr, status, error) {
                $.error.call(that, error);
            }

        })
    },
    //1为成功 2失败 15警告
    mag: function (msg, code = 15, time = 1500) {
        layer.msg(msg, {
            icon: code,
            time: time
        });
    }
};
window.$ = window.$ ? $.extend(lk) : lk;